package cool.mtc.base.plugin.generator.code.model.template.bg;

import cool.mtc.core.util.StringUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 明河
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class BgModelTemplateParam extends BaseBgTemplateParam {

    private List<BgEntityTemplateParam.Field> fieldList = new ArrayList<>();

    @Override
    public String getTemplateRelativePath() {
        return null;
    }

    @Override
    public String getBasePackage() {
        return this.getModelBasePackage();
    }

    @Override
    public String getClassName() {
        return null;
    }

    @Override
    public void handleCheckParamsCorrect() {
        if (StringUtil.isEmpty(this.getEntityBasePackage())) {
            throw new RuntimeException(this.handleMessage("未设置[entityBasePackage]"));
        }
        if (StringUtil.isEmpty(this.getObjectPrefix())) {
            throw new RuntimeException(this.handleMessage("未设置[objectPrefix]"));
        }
    }
}
